package com.my.home.common.utils;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.SessionListener;

import java.util.Date;

/**
 * Created by Al Sah-him on 2018/6/5.
 */
public class MySessionListener  implements SessionListener {

    @Override
    public void onStart(Session session) {
        System.out.println("会话创建：" + session.getId()+"》》时间："+session.getLastAccessTime());
    }

    @Override
    public void onStop(Session session) {
        System.out.println("会话停止：" + session.getId()+"》》时间："+session.getLastAccessTime());
    }

    @Override
    public void onExpiration(Session session) {
        System.out.println("会话过期：" + session.getId()+"》》时间："+new Date());
    }
}
